package com.hzlj.position.locate.common.enums;

import com.fz.common.base.exception.PubError;
import com.fz.common.base.exception.PubException;
import lombok.Getter;

/**
 * @author fanzhuo
 */

@Getter
public enum TbztStatus {
    WAIT("0", "待同步"),
    SUCCESS("1", "同步成功"),
    FAIL("2", "同步失败"),
    ;

    private final String status;
    private final String text;

    TbztStatus(String status, String text) {
        this.status = status;
        this.text = text;
    }

    public static TbztStatus of(String value) {
        for (TbztStatus reportType : values()) {
            if (reportType.getStatus().equals(value)) {
                return reportType;
            }
        }
        throw new PubException(PubError.PARAM_EMPTY_ERROR);
    }

}
